<ion-view view-title="所有商品" id="goods-list" hide-nav-bar="true" ng-controller="GoodsListCtrl">
  <ion-header-bar align-title="center" class="bar-calm">
    <div class="buttons">
      <button class="button head-button button-clear center-btn" ng-click="goBack()">
        <img src="img/order-commit/backIcon.png">
      </button>
    </div>
    <h1 class="title" on-tap="showMenu($event)">
        <span ng-if="$storage.dmCurrentItem.text">
          {{$storage.dmCurrentItem.text}}<span class="ion-android-arrow-dropdown"></span>
        </span>
    </h1>
      <div class="buttons">
          <button class="button head-button button-clear center-btn" ng-if="needOn && $storage.dmCurrentItem.id == '1'" ng-click="batOnLine()">
              上架
          </button>
          <button class="button head-button button-clear center-btn" ng-if="needDown && $storage.dmCurrentItem.id != '1'" ng-click="takeOff()">
              下架
          </button>
      </div>
  </ion-header-bar>
  <ion-content>
    <ion-refresher
        pulling-text="下拉刷新..."
        on-refresh="doRefresh()">
    </ion-refresher>
      <div class="bar bar-header item-input-inset">
          <label id="searchLabel" class="item-input-wrapper">
              <i class="icon ion-ios-search placeholder-icon" style="font-size: 20px"></i>
              <input type="search" placeholder="请输入商品名或商品编号" ng-focus="goGoodsSearch($storage.dmCurrentItem.id)">
          </label>
      </div>
    <img ng-if="nocontent" class="no-content" ng-src="img/no-content.png">
    <swipe-list items="goodsList" item-click="pick" item-remove="remove" item-share="share" need-down-line="needDown" current-item="$storage.dmCurrentItem.id" ng-if="$storage.dmCurrentItem.id != 1"></swipe-list>
    <swipe-list items="goodsList" item-click="pick" item-remove="remove" item-share="share" need-on-line="needOn" current-item="$storage.dmCurrentItem.id" ng-if="$storage.dmCurrentItem.id == 1"></swipe-list>
      <swipe-list items="goodsList" item-click="pick" item-remove="remove" item-share="share" need-down-line="needDown" current-item="$storage.dmCurrentItem.id" ng-if="$storage.dmCurrentItem.id == 5"></swipe-list>
    <div class="bottom-blank"></div>
    <ion-infinite-scroll
        ng-if="canLoadMore()"
        distance="1%"
        immediate-check=false
        on-infinite="loadMore()"></ion-infinite-scroll>

  </ion-content>
  <div class="bar bar-footer">
    <div class="button-container">
      <button class="button button-clear add-button" ng-click="gogoodsadd()">添加商品</button>
      <button class="button button-clear add-button" ng-click="gogoodsManage($storage.dmCurrentItem.id)">{{plglText}}</button>
    </div>
  </div>

</ion-view>
